home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Online / FlushHeaders / new-source / NewSource.lha / str.c < prev   
C/C++ Source or Header  |  2001-06-10  |  2KB  |  76 lines

  1. //#include "Yam2NN.h"
  2.  
  3. /*
  4. **   YAM2NN - Usenet access for YAM p7 and newer
  5. **   Copyright (C) 1999 Karol Bryd <kbryd@femina.com.pl>
  6. **
  7. **   This program is free software; you can redistribute it and/or
  8. **   modify it under the terms of the GNU General Public License
  9. **   as published by the Free Software Foundation; either version 2
  10. **   of the License, or (at your option) any later version.
  11. **
  12. **   This program is distributed in the hope that it will be useful,
  13. **   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. **   GNU General Public License for more details.
  16. **
  17. **   You should have received a copy of the GNU General Public License
  18. **   along with this program; if not, write to the Free Software
  19. **   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21.  
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. #include <ctype.h>
  26.  
  27. #include <proto/dos.h>
  28.  
  29. #ifndef __SASC
  30. char *Stptok(const char *s, char *tok, int toklen, const char *brk)
  31. {
  32.     int pos;
  33.  
  34.     if((s == NULL) || (tok == NULL) || (brk == NULL))
  35.         return(NULL);
  36.  
  37.     if(*s == 0)
  38.         return(NULL);
  39.     pos = 0;
  40.     while(1)
  41.     {
  42.         if(*s == 0)
  43.             break;
  44.         if(strchr(brk, *s))
  45.             break;
  46.  
  47.         tok[pos++] = *s;
  48.         if(pos >= toklen)
  49.             break;
  50.  
  51.         s++;
  52.     }
  53.     tok[pos] = 0;
  54.     return(s);
  55. }
  56.  
  57. char *Stpblk(const char *str)
  58. {
  59.     while(isspace(*str) && *str)
  60.         str++;
  61.     return(str);
  62. }
  63.  
  64. int Astcsma(char *s, char *p)
  65. {
  66.     char out[255];
  67.  
  68.     if(ParsePatternNoCase(p, out, sizeof(out)) > 0)
  69.         if(MatchPatternNoCase(out, s))
  70.             return(TRUE);
  71.  
  72.     return(FALSE);
  73. }
  74. #endif
  75.  
  76.